<template>
  <div>
    <van-nav-bar
      title="砍价列表"
      class="w"
      left-arrow
      @click-left="onClickLeft"
    />
    <van-card
      class="content"
      v-for="item in list"
      :key="item"
      @click="kanxiang(item.id)"
      :price="item.maxCoupons"
      :desc="item.characteristic"
      :title="item.name"
      :thumb="item.pic"
    />
  </div>
</template>
<script>
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    this.$API.kanlist().then((res) => {
      this.list = res.data.data.goodsMap;
    });
  },
  methods: {
    onClickLeft() {
      this.$router.push({ path: "/home" });
    },
    kanxiang(id) {
      this.$router.push({ path: "/kanxiang", query: { id: id } });
    },
  },
};
</script>
<style  scoped>
.w {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
}
.content {
  width: 90%;
  margin-left: 20px;
  margin-top: 66px;
}
</style>